<div class="row" ng-controller="bs_person_sendMsgToUser">

    <div class="col-md-9">

        <div class="row">
            <div class="col-md-12">
                <h4>
                    与 <span ng-bind="receiver.attributes.nickName"></span> 对话
                    <span ng-if="msg.title" ng-bind="msg.title"></span>
                </h4>
                <hr>
            </div>
            <!-- 聊天记录-->
            <div class="row">
                <h3 class="col-md-12" ng-if="statusList.length>0" ng-repeat="status in statusList">
                    <span class="label"
                          style="white-space: pre-wrap"
                          ng-style="{float:status.attributes.source.id==receiver.id ? 'left':'right',backgroundColor:status.attributes.source.id==receiver.id ? '#30bf4c':'#e6e5eb'}"
                          ng-bind="status.attributes.message">
                    </span>
                </h3>
                <!-- 我的输入框-->
                <form class="col-md-12">
                    <div class="form-group">
                        <textarea rows="5"
                                  class="form-control"
                                  placeholder="输入回复内容"
                                  ng-model="msg.sendMsg"
                                  popover-placement="bottom"
                                  popover-template="'common-replay-words-popover.html'"></textarea>
                    </div>
                    <button class="btn btn-danger pull-left" ng-click="goBack()">退出聊天</button>
                    <button class="btn btn-primary pull-right"
                            ng-disabled="!msg.sendMsg || isLoading"
                            ng-click="sendOnClick()">发送
                    </button>
                </form>
            </div>

            <script type="text/ng-template" id="common-replay-words-popover.html">
                <h4>快速回复内容</h4>
                <button style="margin: 5px"
                        class="btn btn-default btn-sm"
                        ng-disabled="isLoading"
                        ng-repeat="word in commonReplayWords"
                        ng-click="msg.sendMsg=word"
                        ng-bind="word"></button>
            </script>
        </div>
    </div>

    <div class="col-md-3">
        <!-- 对方用户信息-->
        <div class="row" ng-if="receiver && usedBook.attributes.alive && usedBook.attributes.owner.id===User$.me().id">
            <div class="col-md-12">
                <button class="btn btn-block btn-primary"
                        ng-if="usedBook.attributes.role==='sell'"
                        ng-click="sellUsedBookToUser()">
                    已决定卖给Ta
                </button>
                <button class="btn btn-block btn-primary"
                        ng-if="usedBook.attributes.role==='need'"
                        ng-click="gainUsedBookFromUser()">
                    已成功从Ta获得
                </button>
                <button class="btn btn-block btn-primary"
                        ng-if="usedBook.attributes.role==='circle'"
                        ng-click="deliverUsedBookToUser()">
                    已决定传递给Ta
                </button>
            </div>
        </div>
        <div class="row" ng-if="receiver">
            <div class="col-md-12">
                <h4>对方信息</h4>
                <hr>
            </div>
            <div class="col-md-12">
                <bs-one-user user="receiver"
                             popover-placement="left"
                             image-size="132"
                             avatar-size="80"
                             margin="5"></bs-one-user>
            </div>
        </div>
        <!-- 二手书信息-->
        <div class="row" ng-if="usedBook">
            <div class="col-md-12">
                <h4>当前图书</h4>
                <hr>
            </div>
            <div class="col-md-12">
                <!-- 二手书信息-->
                <bs-one-used-book used-book="usedBook"
                                  popover-placement="left"></bs-one-used-book>
            </div>
        </div>
    </div>

</div>